package org.esti.model.dao;

import org.esti.model.Appraisal;

import java.util.List;

/**
 * @author Artem Loginov (logart)
 */


/**
 * DAO is used to getKnowledgeFieldById, save and update objects information in database.
 * This dao manage user appraisals.vm.
 */

public interface AppraisalDAO {
    /**
     * Methods retrieve appraisal for specified level.
     *
     * @param levelId identity of level. Appraisal suitable for this level will be returned
     * @return appraisal for specified by levelId level
     */
    Appraisal getAppraisalByLevelId(long levelId);

    /**
     * adding appraisal to DB
     * @param appraisal which will be added
     * @return persisted object
     */
    Appraisal add(Appraisal appraisal);

    /**
     * return list of all appraisals
     * @return list of all appraisals
     */
    List<Appraisal> getAllAppraisals();

    /**
     * return specific appraisal by id
     * @param id of appraisal which will be returned
     * @return appraisal with id specified by parameter
     */
    Appraisal getAppraisalById(long id);

    /**
     * update appraisal in DB
     * @param appraisal which will be updated with new fields
     * @return updated instance
     */
    Appraisal update(Appraisal appraisal);

    /**
     * remove specified appraisal from DB
     * @param id of appraisal which will be removed
     */
    void remove(long id);

    /**
     * return list of all appraisals that is published
     * @return list published appraisals
     */
    List<Appraisal> getAvailableAppraisals();
}
